/*
 * Copyright 2011-2011 Tiago da Fonseca Frazao  All rights reserved.
 */

package mz.co.research.shared.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import javax.validation.constraints.NotNull;

/**
 * @author Tiago da Fonseca Frazao
 */
@MappedSuperclass
public abstract class LifeCycleEntity extends AbstractEntity<LifeCycleEntity> {

	@NotNull
	@Column(name = "ACTIVE", nullable = false)
	private Boolean active;

	@NotNull
	@Column(name = "ACTIVATION_DATE", nullable = false)
	private Date activationDate;

	@NotNull
	@Column(name = "ACTIVATED_BY", nullable = false)
	private Long activatedBy;

	/**
	 * @return the active
	 */

	public Boolean getActive() {
		return active;
	}

	/**
	 * @param active
	 *            the active to set
	 */

	public void setActive(Boolean active) {
		this.active = active;
	}

	/**
	 * @return the activatedBy
	 */
	public Long getActivatedBy() {
		return activatedBy;
	}

	/**
	 * @param activatedBy
	 *            the activatedBy to set
	 */
	public void setActivatedBy(Long activatedBy) {
		this.activatedBy = activatedBy;
	}

	/**
	 * @return the activationDate
	 */

	public Date getActivationDate() {
		return activationDate;
	}

	/**
	 * @param activationDate
	 *            the activationDate to set
	 */

	public void setActivationDate(Date activationDate) {
		this.activationDate = activationDate;
	}

	@Override
	public String toString() {
		StringBuilder buffer = new StringBuilder("\nLifeCycleEntity");

		buffer.append(super.toString());

		buffer.append("\nactivatedBy    :" + this.activatedBy);
		buffer.append("\nactivationDate :" + this.activationDate);

		return buffer.toString();
	}
}
